#ifndef MineCraftAlgorthm_H
#define MineCraftAlgorthm_H

#include <QVector3D>
#include <QVector2D>
#include <QList>
#include <QUrl>
#include <QQuick3DGeometry>

class MineCraftAlgorthm
{
public:
    enum Direction{
        None = 0,
        Left = 0b1,//x-
        Right = 0b10,//x+
        Up = 0b100,//y+
        Down = 0b1000,//y-
        Front = 0b10000,//z+
        Behind = 0b100000,//z-
        All = 0xffffffff
    };


    //通过中心位置和每个面的uv坐标来生成一个mc方块
    static void genMineCraftBlock(QByteArray& out,const QVector3D& centerLocation,const QList<QVector2D>& faces,Direction direction = All/*对面进行过滤*/);
    static void createMeshBlock(QByteArray &out, const QUrl &mesh, const QMatrix4x4 &mtx);
};

#endif
